package com.pan.design.pattern.structural.bridge;

/**
 *
 * 对于两个对象都有可能有多个实现，而且这两个要配合使用
 * Created by geely
 */
public class Test {

    public static void main(String[] args) {

        Bank icbcBank = new ICBCBank(new DepositAccount());
        Account icbcAccount = icbcBank.openAccount();
        icbcAccount.showAccountType();

        Bank icbcBank2 = new ICBCBank(new SavingAccount());
        Account icbcAccount2 = icbcBank2.openAccount();
        icbcAccount2.showAccountType();

        Bank abcBank = new ABCBank(new SavingAccount());
        Account abcAccount = abcBank.openAccount();
        abcAccount.showAccountType();

    }
}
